<template>
  <div>
    <div style="display: none;">{$random_content}</div>
    <div class="mainmodule">
      <div class="mianad" v-if="fxsInfo.is_user_img">
        <a @click="openLink(fxsInfo.user_img_link)">
          <img :src="fxsInfo.user_img_ggt || fxsInfo.ad_img" alt />
        </a>
      </div>
      <div class="mainlist">
        <ul>
          <li v-if="fxsInfo.show_fxSubject">
            <div @click="Jump('agentList')" class="icon_fxzt">
              {{fxsInfo.ftitle_magazine}}
              <i class="icon-right"></i>
            </div>
          </li>
          <li v-if="fxsInfo.show_myCommission">
            <div @click="Jump('myCommission','fxs')" class="icon_wdyj">
              {{fxsInfo.ftitle_commission}}
              <i class="icon-right"></i>
            </div>
          </li>
        </ul>
        <ul>
           <!-- 子容 start -->
          <li v-if="is_zrkj_dz">
            <!-- <div @click="JumpUrl('/user/inviteUserLists')" class="icon_fxdd"> -->
            <div @click="handleLinkTo('shareCouponList')" class="icon_coupon">
              分享中心
              <i class="icon-right"></i>
            </div>
          </li>
          <!-- 子容 end -->
          <li v-if="fxsInfo.display_agent_sort && fxsInfo.show_monthRank">
            <div @click="Jump('commissionSort')" class="icon_syyjph">
              {{fxsInfo.ftitle_ranking}}
              <i class="icon-right"></i>
            </div>
          </li>
          <li v-if="!fxsInfo.is_app_open && fxsInfo.is_store_log == 1 && fxsInfo.show_myStore">
            <div @click="Jump('store')" class="icon_dzd">
              {{fxsInfo.ftitle_store}}
              <i class="icon-right"></i>
            </div>
          </li>
          <li class="getfxcode" v-if="fxsInfo.show_qrcode" @click="_show_qrcode()">
            <div class="icon_ewm">
              二维码
              <i class="icon-right"></i>
            </div>
          </li>
          <li v-if="fxsInfo.show_highLevel && fxsInfo.superior_user_id">
            <div @click="Jump('fxsDirector')" class="icon_wdsj">
              {{fxsInfo.ftitle_superior}}
              <i class="icon-right"></i>
            </div>
          </li>
          <li v-if="fxsInfo.show_fx_card">
            <div @click="Jump('fxCard')" class="icon_card">
              我的名片
              <i class="icon-right"></i>
            </div>
          </li>
          <li v-if="fxsInfo.show_fx_apply">
            <div @click="showFxsEwm()" class="icon_ewm">
              {{fxsInfo.ftitle_agent_apply}}
              <i class="icon-right"></i>
            </div>
          </li>
          <!-- 定制 贵州己乐识界信息科技 分红奖励 start v-if="fxsInfo.is_fhjl" -->
          <li v-if="fxsInfo.is_fhjl">
            <!-- <div @click="JumpUrl('/user/inviteUserLists')" class="icon_fxdd"> -->
            <div @click="handleLinkTo('jljsBonus')" class="icon_fhjl">
              分红奖励
              <svg-icon icon-class="icon_right" class="icon_right"></svg-icon>
            </div>
          </li>
          <!-- 定制 贵州己乐识界信息科技 分红奖励 end -->
          <!-- 定制  分红奖励 start v-if="fxsInfo.is_fhjl" -->
          <li v-if="fxsInfo.is_five_bonus_dz">
            <!-- <div @click="JumpUrl('/user/inviteUserLists')" class="icon_fxdd"> -->
            <div @click="handleLinkTo('dzFenHong')" class="icon_fhjl">
              分红奖励
              <svg-icon icon-class="icon_right" class="icon_right"></svg-icon>
            </div>
          </li>
          <!-- 定制  分红奖励 end -->
          <li v-if="fxsInfo.showShareLinkFxs">
            <div @click="handleLinkTo('shareSelect')" class="icon20_1_fx">
            万能链接
              <svg-icon icon-class="icon_right" class="icon_right"></svg-icon>
            </div>
          </li>
          <!-- 视频号数据 -->
          <li v-if="fxsInfo.show_video_num_data_fxs">
            <div @click="Jump('venderOrder', 'live')"
                 class="icon_sphsj">视频号数据
              <span></span>
              <svg-icon icon-class="icon_right"
                        class="icon_right"></svg-icon>
            </div>
          </li>
        </ul>
        <!-- 自定义项 -->
        <ul v-if="fxsInfo.dataset_fxs && fxsInfo.dataset_fxs.length>0">
          <li v-for="(item,index) in fxsInfo.dataset_fxs"
              :key="index">
            <a
               @click="JumpUrl(item.link)"
              class="custom_item"
              :style="{backgroundImage: 'url('+item.pic+')'}">
              {{item.showtitle}}
              <svg-icon icon-class="icon_right"
                        class="icon_right"></svg-icon>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
import small from '@/smallapp/small'
import { openPage } from '@/utils/utils.js'
export default Vue.extend({
  props: {
    fxsInfo: {
      type: Object
    }
  },
  data() {
    return {
      // 子容
      is_zrkj_dz: false
    }
  },
  methods: {
    // TODO 小程序跳转
    openLink(link) {
      openPage(link)
    },
    Jump(url, type) {
      const data = { type }
      this.$JumpPath(this, url, data)
    },
    JumpUrl(url) {
      openPage(url)
    },
    handleLinkTo(url, data) {
      this.$JumpName(this, url, data)
    },
    _show_qrcode() {
      this.$emit('showQrcode')
    },
    showFxsEwm() {
      this.$emit('showFxsEwm')
    }
  },
  created() {
    let shop = small.globalData.shopId
    // 子容
    const is_zrkj_dz = this.$_shop('$_zrkj_dz', shop)
    this.is_zrkj_dz = is_zrkj_dz
  }
})
</script>

<style lang="scss">
@import 'src/styles/user/index.scss';
</style>
